﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ITAP.ContourBuilder.GUI
{
    public enum SetLengthFrom
    {
        Start, 
        End
    }

    public partial class FormSetElementLength : Form
    {
        public SetLengthFrom LengthType
        {
            get
            {
                if (this.radioButtonFromStart.Checked)
                    return SetLengthFrom.Start;
                else
                    return SetLengthFrom.End;
            }
        }

        public double Length
        {
            get
            {
                return (double)numericUpDownLength.Value;
            }
        }

        public FormSetElementLength(double initialLength)
        {
            InitializeComponent();
            this.numericUpDownLength.Value = (decimal)initialLength;
            this.radioButtonFromStart.Checked = true;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
